#define _CRT_SECURE_NO_WARNINGS 1

void writeFile(Arrays* arrays)
{
    FILE* p = fopen(PATH, "w");
    char buff[1024] = {};
    int i = 0;;
    for (i = 0; i < arrays->cur; i++)
    {
        fprintf(p, "%s %d %c %.2f\n", arrays->arr[i].name, arrays->arr[i].id, arrays->arr[i].sex, arrays->arr[i].result);
    }


}

void readFile(Arrays* arrays)
{
    FILE* p = fopen(PATH, "r");
    int ret = 1;

    while (ret != EOF)
    {
        checkCapacity(arrays);
        ret = fscanf(p, "%s %d %c %f\n", arrays->arr[arrays->cur].name, &arrays->arr[arrays->cur].id, &arrays->arr[arrays->cur].sex, &arrays->arr[arrays->cur].result);

        if (ret != EOF) arrays->cur++;
    }
}
